//
//  RACSubscriber+AFProgressCallbacks.h
//  Reactive AFNetworking Example
//
//  Created by Robert Widmann on 3/28/13.
//  Copyright (c) 2013 CodaFi. All rights reserved.
//

#import <ReactiveObjC/ReactiveObjC.h>

@protocol ADSubscriber<RACSubscriber>

- (void)sendProgress:(float)value;

@end

@interface RACSubscriber<ADSubscriber>

+ (instancetype)subscriberWithNext:(void (^)(id x))next progress:(void (^)(float progress))progress error:(void (^)(NSError *error))error completed:(void (^)(void))completed;
+ (instancetype)subscriberWithNext:(void (^)(id x))next error:(void (^)(NSError *error))error completed:(void (^)(void))completed;

- (void)sendProgress:(float)value;

@end

@interface RACSubscriber (ADProgress)

@property (nonatomic, copy) void (^progress)(float progress);

+ (instancetype)subscriberWithNext:(void (^)(id x))next progress:(void (^)(float progress))progress error:(void (^)(NSError *error))error completed:(void (^)(void))completed;

- (void)sendProgress:(float)value;

@end

@interface RACSignal (ADProgress)

- (RACDisposable *)subscribeProgress:(void (^)(float progress))progressBlock next:(void (^)(id x))nextBlock;

- (RACDisposable *)subscribeProgress:(void (^)(float progress))progressBlock next:(void (^)(id x))nextBlock error:(void (^)(NSError *error))errorBlock;

- (RACDisposable *)subscribeProgress:(void (^)(float progress))progressBlock next:(void (^)(id x))nextBlock error:(void (^)(NSError *error))errorBlock completed:(void (^)(void))completedBlock;

@end

@interface RACSubject (ADProgress)

- (void)sendProgress:(float)value;

@end
